import 'package:flutter/cupertino.dart';
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';

import '../components/custom_toast.dart';
import '../config/service_url.dart';
import '../model/bill_hot_search.dart';
import '../model/login_model.dart';
import '../utils/http_util.dart';

/* 测试数据的页面哒哒哒 */

class TestPage extends StatefulWidget {
  const TestPage({super.key});

  @override
  _TestPageState createState() => _TestPageState();
}

class _TestPageState extends State<TestPage> {
  List<Map<String, dynamic>> responseData = [];

  Future<void> fetchData() async {
    // Response result = await HttpUtil.get(billHotSearch);

    // 获取鲜花信息
    await HttpUtil.get(getFlowerList);


    //
    // setState(() {
    //   responseData = baseModel.data as List<Map<String, dynamic>>;
    // });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Test Page'),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            ElevatedButton(
              onPressed: fetchData,
              child: Text('Fetch Data'),
            ),
            SizedBox(height: 20),
            Container(
              padding: EdgeInsets.all(10),
              decoration: BoxDecoration(
                border: Border.all(),
              ),
              child: Column(
                // children: responseData.map((data) => Text(data['name'])).toList(),
              ),
            ),
          ],
        ),
      ),
    );
  }
}